import com.bit.demo2.Test;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 晓星航
 * Date: 2022-11-17
 * Time: 19:41
 */
class Animal {
    protected String name;
    public Animal(String name) {
        this.name = name;
    }
}
interface IFlying {
    void fly();
}
interface IRunning {
    void run();
}
class Bird extends Animal implements IFlying {
    public Bird(String name) {
        super(name);
    }
    @Override
    public void fly() {
        System.out.println(this.name + "正在飞！");
    }
}
class Dog extends Animal implements IRunning {
    public Dog(String name) {
        super(name);
    }

    @Override
    public void run() {
        System.out.println(this.name + "正在跑！");
    }
}
public class TestDemo {
public static void runFunc(IRunning iRunning) {
    iRunning.run();
}
public static void flyFunc(IFlying iFlying) {
    iFlying.fly();
}
    public static void main(String[] args) {
    runFunc(new Dog("狗"));
    flyFunc(new Bird("鸟"));

    }
}
